FROM uwsgi:base

WORKDIR /app
COPY app /app
COPY cmd.sh /app
COPY requirements.txt /app
# 创建uwsgi 用户和用户组
RUN groupadd -r uwsgi && useradd -r -g uwsgi uwsgi && \
   pip install -r /app/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

EXPOSE 9090 9191
#指明 主机于其他容器访问的端口
USER uwsgi
#https://dormousehole.readthedocs.io/en/latest/deploying/uwsgi.html
CMD [ "/app/cmd.sh"]
#CMD [ "uwsgi", "--http","0.0.0.0:9090","--module","app:app"]
#CMD [ "uwsgi", "--http","0.0.0.0:9090","--manage-script-name","--mount"," /app/app=app:app"]
#, "--callable" , "app", "stats","0.0.0.0:9191"]
#CMD ["python","app.py"]
#]